#include<stdio.h>
#include<conio.h>
void main()
{
	long int n, i, f = 1, e;

	clrscr();

	printf("\n\n\t\tEnter any no. ");
	n = getche();

		if(n >= 48 && n <= 57)
		{
			printf("Valid Number");
		}

		else
		{
			printf("Invalid Number");
		}

		for(i = n; i >= 1 ; i--)
		{

			printf("\n\n\t\t%d * %d = %d",i,e,f);
			e = f;
			f = f * i;
		}

		printf("\n\n\t\tFactorial = %d", f);


	getch();

}